package com.ruoyi.edubuy.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.edubuy.domain.ShowShopping;
import com.ruoyi.edubuy.mapper.ShowShoppingMapper;
import com.ruoyi.edubuy.service.IShowShoppingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 购物车XService业务层处理
 *
 * @author lsj
 * @date 2021-07-13
 */
@Service
public class ShowShoppingServiceImpl implements IShowShoppingService {
    @Autowired
    private ShowShoppingMapper showShoppingMapper;

    /**
     * 查询购物车X
     *
     * @param shoppingId 购物车XID
     * @return 购物车X
     */
    @Override
    public ShowShopping selectShowShoppingById(Long shoppingId) {
        return showShoppingMapper.selectShowShoppingById(shoppingId);
    }

    /**
     * 查询购物车X列表
     *
     * @param showShopping 购物车X
     * @return 购物车X
     */
    @Override
    public List<ShowShopping> selectShowShoppingList(ShowShopping showShopping) {
        return showShoppingMapper.selectShowShoppingList(showShopping);
    }

    /**
     * 新增购物车X
     *
     * @param showShopping 购物车X
     * @return 结果
     */
    @Override
    public int insertShowShopping(ShowShopping showShopping) {
        return showShoppingMapper.insertShowShopping(showShopping);
    }

    /**
     * 修改购物车X
     *
     * @param showShopping 购物车X
     * @return 结果
     */
    @Override
    public int updateShowShopping(ShowShopping showShopping) {
        return showShoppingMapper.updateShowShopping(showShopping);
    }

    /**
     * 删除购物车X对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShowShoppingByIds(String ids) {
        return showShoppingMapper.deleteShowShoppingByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除购物车X信息
     *
     * @param shoppingId 购物车XID
     * @return 结果
     */
    @Override
    public int deleteShowShoppingById(Long shoppingId) {
        return showShoppingMapper.deleteShowShoppingById(shoppingId);
    }
}
